Unidentified
error PHP/MySQL - home directory directive
Product:
Dreamweaver
Platform:
All
Versions:
MX
ID:
16515
Issue When
attempting to connect to a MySQL database through Dreamweaver MX the
following error occurs:
An
unidentified error has occurred.
Reason A cause for this error
may be that the "." (or "look in the home directory" directive) has been
removed from the "include_path =" line in the PHP configuration file named
php.ini, or the entire line has been commented out. Dreamweaver MX relies
on some pre-written scripts to create and test database connections to the
database server while designing your site.
The scripts for the
PHP/MySQL server model were written to use the default configuration of
PHP. In other words, the Dreamweaver MX scripts look for these scripts in
the home directory first before searching elsewhere for the include files.
If the "." directive has been removed from the include_path line in the
php.ini file, Dreamweaver MX will not know that these scripts exist and
cannot make a successful database connection.
Note: By default, the include_path in the php.ini file in Windows is
commented out.
Solutions There are two ways to resolve this issue:
Concatenate the "." to the "include_path=" line of the php.ini
file:
Change
to read: include_path =
".:/php/includes:/usr/share/php"
You may need to restart your
PHP server after the changes have been
made.
Note: In
some cases the "include_path=" line may be commented by a ";" at the
beginning of the line. Remove the ";" at the beginning of the
line.
The second solution is to alter the file that helps
to build and test Dreamweaver's connection script. This solution is only
recommended if you don't have access to the php.ini file or the
"include_path" cannot be altered for other reasons.
The file that
needs to be changed is called MMHTTPDB.php. You can find this file in the
Dreamweaver MX installer folder (the default is C:\Program
Files\Macromedia\Dreamweaver
MX\Configuration\Connections\Scripts\PHP_MySQL\_mmDBScripts and in Mac OS
X, the path is Hard Drive:Applications:Macromedia Dreamweaver
MX:Configuration:Connections:Scripts:PHP_MySQL:_mmDBScripts).
Once you
have found the file make a backup of it. Open the original in Dreamweaver
or any text editor and look for line 15.
Line 15 of the MMHTTPDB.php file reads:
require("mysql.php");
Change it to read:
require("./mysql.php");
It is important to include
the semi-colon or the quotes. Save the file in the _mmDBScripts directory.
Close and restart Dreamweaver and create a brand new file attempting the connection
again.
Additional
Information For
more information on how to configure the php.ini file, check the PHP
documentation.